﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace aier.dataaccess.model
{
    [XrmEntity("lead", "leadid")]
    public class Patient
    {
        [XrmFieldMapping("leadid", XrmAttributeType.UniqueIdentifier)]
        public Guid leadid
        {
            get;
            set;
        }

        /// <summary>
        /// 患者姓名
        /// </summary>
        [XrmFieldMapping("lastname", XrmAttributeType.String, true)]
        public string fullname
        {
            get;
            set;
        }



        /// <summary>
        /// 0:未知的性别
        /// 1:男性
        /// 2:女性
        /// </summary>
        [XrmFieldMapping("new_gender", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_gender
        {
            get;
            set;
        }

        /// <summary>
        /// 年龄
        /// </summary>
        [XrmFieldMapping("new_age", XrmAttributeType.Int, true)]
        public int? new_age
        {
            get;
            set;
        }

        /// <summary>
        /// 出生日期
        /// </summary>
        [XrmFieldMapping("new_birthdate", XrmAttributeType.DateTime, true)]
        public DateTime? new_birthdate
        {
            get;
            set;
        }


        [XrmFieldMapping("address1_telephone1", XrmAttributeType.String, true)]
        public string address1_telephone1
        {
            get;
            set;
        }

        /// <summary>
        /// 身份证号
        /// </summary>
        [XrmFieldMapping("new_citizenid", XrmAttributeType.String, true)]
        public string new_citizenid
        {
            get;
            set;
        }

        /// <summary>
        /// 常住详细地址
        /// </summary>
        [XrmFieldMapping("address1_name", XrmAttributeType.String, true)]
        public string address1_name
        {
            get;
            set;
        }

        /// <summary>
        /// 说明
        /// </summary>
        [XrmFieldMapping("description", XrmAttributeType.String, true)]
        public string description
        {
            get;
            set;
        }

        /// <summary>
        /// 首次来源方式
        /// 1:网络
        /// 2:电话咨询
        /// 3:筛查
        /// 4:网医
        /// 5:会员
        /// 6:大客户
        /// 7:校园
        /// 8:自然
        /// 9:其他
        /// </summary>
        [XrmFieldMapping("new_patientsource", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_patientsource
        {
            get;
            set;
        }


        /// <summary>
        /// 建档场景说明
        /// </summary>
        [XrmFieldMapping("new_sourceremark", XrmAttributeType.String, true)]
        public string new_sourceremark
        {
            get;
            set;
        }


        /// <summary>
        /// 推广来源
        /// </summary>
        [XrmFieldMapping("new_mxqd", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_mxqd
        {
            get;
            set;
        } = 100000024;

        /// <summary>
        /// 病种 1：白内障 2：儿童眼病 3: 高度近视 4:角膜及眼表 5:角膜塑形镜 6:泪道病 7:近视手术 8:斜弱视 9:眼底病
        ///      10:眼整形眼眶病 11:医学验光配镜 12:青光眼 13:其他 14:角膜移植 15:VIP特需门诊 
        /// </summary>
        [XrmFieldMapping("new_disease", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_disease
        {
            get;
            set;
        }

        /// <summary>
        ///是否幼儿筛查
        /// </summary>
        [XrmFieldMapping("initialcommunication", XrmAttributeType.XrmOptionSetValue, true)]
        public int? initialcommunication
        {
            get;
            set;
        }


        /// <summary>
        /// 科普
        /// </summary>
        [XrmFieldMapping("new_popularscience", XrmAttributeType.Boolean, true)]
        public bool? new_popularscience
        {
            get;
            set;
        }

        [XrmFieldMapping("new_inputingtime", XrmAttributeType.DateTime, true)]
        public Nullable<DateTime> new_inputingtime { get; set; }





        [XrmFieldMapping("new_datasource", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_datasource
        {
            get;
            set;
        } = 28;
    }
}
